* {
    box-sizing: border-box;
}

body {
    /* 弹性布局垂直居中 */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f8f1e7;
}

.container {
    display: flex;
    width: 90vw;
}

.box {
    /* 子元素绝对定位，父元素相对定位 */
    position: relative;
    /* flex元素在主轴上的比例 */
    flex: 0.5;
    height: 80vh;
    margin: 10px;
    border-radius: 50px;
    /* 添加阴影 */
    box-shadow: 2px 2px 10px 0px #b7b7b7;
    /* 调整背景图片 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #fff;
    cursor: pointer;
    /* 添加过渡效果 */
    transition: flex 0.8s ease-in;
}

.box h3 {
    /* 绝对定位 */
    position: absolute;
    right: 20px;
    bottom: 20px;
    margin: 0;
    font-size: 28px;
    opacity: 0;
    transition: opacity 0.2s ease-in;
}

.active {
    /* 增加元素在主轴比例 */
    flex: 5;
}

.active h3 {
    opacity: 1;
}